package com.cl.cloud.tenant.controller;

import com.cl.core.redis.cache.RedisProtoStuffOpt;
import com.cl.core.common.model.RequestData;
import com.cl.core.common.model.ResponseData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @description:
 * @author: liuzijian
 * @time: 2021-05-28 15:40
 */
@RestController
@RequestMapping("/test")
public class TestController {

    @Autowired
    private RedisProtoStuffOpt redisProtoStuffOpt;

    @PostMapping("/test")
    public ResponseData<?> test(String params,@RequestBody String json) {
        throw new RuntimeException("测试");
//        redisProtoStuffOpt.hSet("test1", "key", "123");
//        String value = redisProtoStuffOpt.hGet("test1", "key");
//        return ResponseData.success(new Date());
    }

    @PostMapping("/test2")
    public ResponseData<?> test2(@RequestBody RequestData data) {
        return ResponseData.success(data.getData());
    }

}
